package com.zhou.datapick;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

/**
 * @author lang.zhou
 * @since 2023/1/16 14:52
 */
@EqualsAndHashCode(callSuper = true)
@Data
@NoArgsConstructor
public class DataUnit<T> extends ArrayList<T> {
    private static final long serialVersionUID = 1L;

    private DataKey key;

    public DataUnit(DataKey key, List<T> data) {
        super(data);
        this.key = key;
    }

    public DataUnit(DataUnit<T> unit) {
        super(unit);
        this.key = unit.getKey();
    }
    public DataUnit(DataKey key) {
        this.key = key;
    }

}
